import request from '@/utils/request'

export function getaddressList(data) {
	return request({
		url: "/wuliu/userAddress/list",
		method: "GET",
		data
	});
}

export function addAddressList(data) {
	return request({
		url: "/wuliu/userAddress",
		method: "POST",
		data
	});
}

export function putAddressDetail(data) {
	return request({
		url: "/wuliu/userAddress/",
		method: "PUT",
		data
	});
}

export function getAddressDetail(id) {
	return request({
		url: "/wuliu/userAddress/" + id,
		method: "GET"
	});
}

export function getInternationalAddress(data) {
	return request({
		url: "/wuliu/order/getInternationalAddress",
		method: "GET",
		data
	});
}

export function delAddressList(id) {
	return request({
		url: "/wuliu/userAddress/" + id,
		method: "DELETE",
		data: {
			ids: [id]
		}
	});
}

export function getCityList(data) {
	return request({
		url: "/wuliu/region/list",
		method: "GET",
		data
	});
}

export function fetchEstimatedPrice(data) {
	return request({
		url: "/wuliu/api/getPriceQuery",
		method: "GET",
		data
	});
}

export function getDictData(type) {
	return request({
		url: `/wuliu/api/type/${type}`,
		method: "GET"
	});
}

// 新增顺丰订单
export const getAddSFExpressAPI = (data) => {
	return request({
		url: '/wuliu/order',
		method: 'POST',
		headers: {
			repeatSubmit: false
		},
		data
	})
}
// 新增京东订单
export const getAddJDExpressAPI = (data) => {
	return request({
		url: '/wuliu/order/jingdongAdd',
		method: 'POST',
		headers: {
			repeatSubmit: false
		},
		data
	})
}

// 新增国际订单
export const getAdddhlExpressAPI = (data) => {
	return request({
		url: '/wuliu/order/dhlAdd',
		method: 'POST',
		headers: {
			repeatSubmit: false
		},
		data
	})
}

export const getOrderListAPI = (data) => {
	return request({
		url: '/wuliu/order/mylist',
		method: 'GET',
		data
	})
}

export const queryExpressInfoApi = (id) => {
	return request({
		url: '/wuliu/order/queryExpressInfo',
		method: 'GET',
		data: {
			id
		}
	})
}

export function isYjzhhfApi(data) {
	return request({
		url: "/wuliu/api/isYjzhhf",
		method: "GET",
		data
	});
}